package com.centronix.dao;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.centronix.domain.Expense;
@Repository
public interface ExpenseDAO extends JpaSpecificationExecutor<Expense>, JpaRepository<Expense, Integer> {
	@Query("select exp from Expense exp where exp.date = :expenseDate")
	public List<Expense> findByDate(@Param("expenseDate") Date expenseDate);
	
	//@Query("update Expense exp set exp.amount = :amount and exp.date = :expenseDate and exp.description = :des where exp.expenseId = :expId")
	//public Boolean updateExpense(@Param("amount") float expAmount, @Param("expenseDate") Date expenseDate, @Param("des") String description, @Param("expId") int expId);
}
